package demo1;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: WHY
 * Date: 2022-10-25
 * Time: 20:28
 */
public class Rectangle extends Shape {
    private int weight;
    private int height;
    public Rectangle(int weight,int height){
        this.weight=weight;
        this.height=height;

    }
    public int getWeight(){
        return weight;
    }
    public int getHeight(){
        return height;
    }
    //方法的重写

    public double getArea(){
        return weight*height;
    }
    public double getC(){
        return 2*weight*height;
    }
}
